#include "historysweeper.h"

struct
{
	char*  szDescr;
	char*  szName;
	int    defIconID;
	HANDLE hIconLibItem;
}
static iconList[] =
{
	{	"Main",				    "hs_main_icon",				IDI_MAINICON		}

};

HANDLE __stdcall GetIconHandle( int iconId )
{
	int i;
	for ( i=0; i < SIZEOF(iconList); i++ )
		if ( iconList[i].defIconID == iconId )
			return iconList[i].hIconLibItem;
		return NULL;
}


void IconsInit( void )
{
	int i;
	SKINICONDESC sid = {0};
	char szFile[MAX_PATH];
	GetModuleFileNameA(hInst, szFile, MAX_PATH);
	
	sid.cbSize = sizeof(SKINICONDESC);
	sid.pszDefaultFile = szFile;
	sid.cx = sid.cy = 16;
	sid.pszSection = Translate( ModuleName );
	
	for ( i = 0; i < SIZEOF(iconList); i++ ) {
		char szSettingName[100];
		wsprintf(szSettingName, "%s_%s", ModuleName, iconList[i].szName); 
		sid.pszName = szSettingName;
		sid.pszDescription = Translate( iconList[i].szDescr );
		sid.iDefaultIndex = -iconList[i].defIconID;
		iconList[i].hIconLibItem = ( HANDLE )CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
	}
}

